package com.seu.project.seuquiz.model.converter;

import com.seu.project.seuquiz.model.dto.userQuestionMap.UserQuestionMapUpdateRequest;
import com.seu.project.seuquiz.model.entity.UserQuestionMap;

/**
 * @author SoftPro
 * @createDate: 2023-07-16 14:42
 */
public class UserQuestionMapConverter {

    /**
     * 将 UserQuestionMapUpdateRequest 转化为 UserQuestionMap
     * @param updateRequest
     * @return
     */
    public static UserQuestionMap userQuestionMapQueryRequestToUserQuestionMap(UserQuestionMapUpdateRequest updateRequest) {
        if (updateRequest == null) {
            return null;
        }

        return UserQuestionMap.builder()
                .id(updateRequest.getId())
                .studentId(updateRequest.getStudentId())
                .questionId(updateRequest.getQuestionId())
                //.score(updateRequest.getScore())
                .build();
    }
}
